Frontend Forever App
We have a mobile app for you to download and use. And you can unlock many features in the app.
Get it now
Intall Later
Run
HTML
CSS
Javascript
Output
Document
Toadly
Animated
Text
@charset "UTF-8"; @import url(https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800); *, :after, :before { box-sizing: border-box; padding: 0; margin: 0; } body { margin: 12vh; text-align: center; font-size: calc(8vw + 8vh); background: #314d79; color: #fff; font-family: sans-serif; letter-spacing: -.3vw; overflow: hidden; font-family: "Lacquer", system-ui; } .rugrats { margin: 0 auto; text-align: center; } .rugrats span { display:inline-block; transition: color linear 0.5s forwards; -webkit-text-stroke-width: .32vw; -webkit-text-stroke-color: black; text-shadow: .4vw .5vw #000; } .rugrats span { text-transform:capitalize; text-transform:lowercase; /* animation:caseChange 5s ease infinite forwards; } @keyframes caseChange{ from{ text-transform:uppercase; } to{ text-transform:lowercase; } } */ }
console.log("Event Fired") var divs = document.querySelectorAll(".rugrats"); divs.forEach(function(div) { var text = div.textContent; div.innerHTML = ""; for (var i = 0; i < text.length; i++) { var span = document.createElement("span"); span.textContent = text[i]; div.appendChild(span); } var spans = div.querySelectorAll('span'); function shuffle(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } spans = shuffle(Array.from(spans)); function getRandomValue() { return Math.random() * 0.4 - 0.24; } function applyRandomTransform() { spans.forEach(function(span) { var xOffset = getRandomValue() * 10; var yOffset = getRandomValue() * 15; var rotation = getRandomValue() * 6; span.style.transform = 'translate(' + xOffset + 'px, ' + yOffset + 'px) rotate(' + rotation + 'deg)'; span.style.textIndent = xOffset + 'px'; }); } function getRandomColor() { var letters = '0123456789ABCDEF'; var color = '#'; for (var i = 0; i < 6; i++) { color += letters[Math.floor(Math.random() * 16)]; } return color; } var currentIndex = 0; function changeColorSequentially() { spans.forEach(function(span, index) { var colorIndex = (index + currentIndex) % spans.length; span.style.color = (colorIndex === 0) ? getRandomColor() : spans[colorIndex - 1].style.color; }); currentIndex = (currentIndex + 1) % spans.length; } setInterval(changeColorSequentially, 250); setInterval(applyRandomTransform, 100); });